/*
 * KudoGDX is a simple library for KudoDEV using various other libraries.
 * It is aimed towards making game development easier.
 */
package com.kudo.gdx.test;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.kudo.gdx.GameContainer;
import com.kudo.gdx.Graphics;
import com.kudo.gdx.ui.components.Button;
import com.kudo.gdx.ui.components.Frame;
import com.kudo.gdx.ui.components.VerticalScrollBar;
import com.kudo.gdx.ui.components.TextField;
import com.kudo.gdx.ui.event.MouseListener;

/**
 *
 * @author Ike
 */
public class GameTemplate extends GameContainer {

    public GameTemplate(int w, int h) {
        super(w, h);
    }

    @Override
    public void init() {
        createGUI(); //Not necessary if you won't be using a GUI.
        //UI debug options
        getGUI().setShowDebugPanel(true);
        //getGUI().setDebugMode(true);

        //test UI
        Frame frame1 = new Frame(50, 50, 120, 150);
        frame1.setText("Test Frame");
        Button button1 = new Button("btn1");
        button1.setLocation(5, 50);
        frame1.add(button1);
        frame1.pack();
        getGUI().addFrame(frame1);


        Frame frame2 = new Frame(70, 70, 120, 150);
        frame2.setText("Test Frame");
        getGUI().addFrame(frame2);


        Frame frame3 = new Frame(90, 90, 120, 150);
        frame3.setText("Test Frame");
        TextField textfield1 = new TextField(5, 5, 50, 20);
        frame3.add(textfield1);
        Button button2 = new Button("btn2");
        button2.setLocation(5, 50);
        frame3.add(button2);

        VerticalScrollBar scroll = new VerticalScrollBar(50, 15, 20, 80, 80);
        frame3.add(scroll);
        frame3.pack();
        getGUI().addFrame(frame3);

    }

    @Override
    public void update(float delta) {
    }

    @Override
    public void draw(Graphics g) {
    }

    //------Start Input------//
    @Override
    public boolean keyDown(int keycode) {
        return false;
    }

    @Override
    public boolean keyUp(int keycode) {

        return false;
    }

    @Override
    public boolean keyTyped(char character) {
        return false;
    }

    @Override
    public boolean touchDown(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchUp(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchDragged(int screenX, int screenY, int pointer) {
        return false;
    }

    @Override
    public boolean mouseMoved(int screenX, int screenY) {
        return false;
    }

    @Override
    public boolean scrolled(int amount) {
        return false;
    }
    //------End Input------//

    public static void main(String[] args) {
        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "Template";
        cfg.useGL20 = true;
        cfg.width = 800;
        cfg.height = 600;
        cfg.resizable = false;
        cfg.vSyncEnabled = false;
        GameTemplate game = new GameTemplate(cfg.width, cfg.height);
        new LwjglApplication(game, cfg);
    }
}
